<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
        $('#table')
          .dropdown({
//            action: 'hide',
              onChange: function (value, text, $selectedItem) {
                  var tbody=window.document.getElementById("tbody-result");
                  var tbody2=window.document.getElementById("tbody-result2");
                  $.ajax({
                      url:"year/?year="+year+"&table=" + tableType,
                      type:'GET',
                      success:function (msg) {
{#                          反序列化#}
                          var data = eval('(' + msg + ')');
                          console.log(typeof(msg));
                          var table_data = data['detail_info'];
                          console.log(table_data)
                          var str1 = '';
                          var str2 = '';
                          if (!table_data){
                              tbody.innerHTML='';
                              tbody2.innerHTML='';
                              return
                          }
                          for ( k in table_data){
                              console.log(k)
                              str1 += "<tr>" +
                                          "<td>"+ table_data[k]['province'] +"</td>" +
                                          "<td>"+ table_data[k]['year_total'] +"</td>" +
                                          "<td>"+ table_data[k]['month1'] +"</td>" +
                                          "<td>"+ table_data[k]['month2'] +"</td>" +
                                          "<td>"+ table_data[k]['month3'] +"</td>" +
                                          "<td>"+ table_data[k]['month4'] +"</td>" +
                                          "<td>"+ table_data[k]['month5'] +"</td>" +
                                          "<td>"+ table_data[k]['month6'] +"</td>" +
                                          "<td>"+ table_data[k]['month7'] +"</td>" +
                                          "<td>"+ table_data[k]['month8'] +"</td>" +
                                          "<td>"+ table_data[k]['month9'] +"</td>" +
                                          "<td>"+ table_data[k]['month10'] +"</td>" +
                                          "<td>"+ table_data[k]['month11'] +"</td>" +
                                          "<td>"+ table_data[k]['month12'] +"</td>" +
                                    "</tr>"
                              str2 += "<tr>"+
                                        "<td>"+ table_data[k]['province'] +"</td>" +
                                        "<td>"+ table_data[k]['base_company_count'] +"</td>" +
                                        "<td>"+ table_data[k]['base_monitor_count'] +"</td>" +
                                        "<td>"+ table_data[k]['base_monitor_info_count'] +"</td>" +
                                      "</tr>"
                          }
                          tbody.innerHTML = str1;
                          tbody2.innerHTML = str2;

                      }
                  })

              }
          });
</script>
</body>
</html>